<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>{{$books->book_name}} 短评</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="夜读书中文网">
    <meta name="keywords" content="读书,阅读,小说,文学">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/yds.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/ucenter.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
    {{-- umeditor --}}
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ueditor.config.js') }}"></script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ueditor.all.js') }}"> </script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/lang/zh-cn/zh-cn.js') }}"></script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ajaxcheck.js') }}"></script>
    {{-- umeditor end --}}
</head>
<body>
@include('books.partials.navtop')
@include('books.partials.nav')
<div id="yds_screen">
<div id="yds_content" class="clearfix">
  <div class="review">
   <h1>{{$books->book_name}} 短评</h1>
   {{-- 回复编辑器 --}}
        @if(Session::has('name'))
        <div class="aw-mod aw-replay-box question">
            <form id="form" role="form" action="{{ asset('bookscomments') }}" method="post">
            <input type="hidden" name="_token" value="{{ csrf_token() }}" />
            <input type="hidden" name="bookid" id="bookid" value="{{ $books->book_id }}" />
              <div class="mod-head">
                <a class="aw-user-name" href="{{url('u')}}/{{$users->uid}}">
                @if($users->avatar_file_min!="")
                <img src="http://www.yedushu.com/{{ $users->avatar_file_min }}">
                @else
                <img src="http://www.yedushu.com/usersface/default/avatar-min.png">
                @endif
                </a>
                <p>
                <a href="{{url('u')}}/{{$users->uid}}">{{ $users->user_name }}</a>
                <span for="title" class="">评分：</span>
                <label>
                  <input type="radio" name="rating" id="rating" value="1">很差
                </label>
                <label>
                  <input type="radio" name="rating" id="rating" value="2">较差 
                </label>
                <label>
                  <input type="radio" name="rating" id="rating" value="3">还行
                </label>
                <label>
                  <input type="radio" name="rating" id="rating" value="4">推荐
                </label>
                <label>
                  <input type="radio" name="rating" id="rating" value="5" checked="checked">力荐
                </label>  
                </p>                
              </div>
                <div class="form-group">
                    <script id="editor" name="message" type="text/plain" style="width:100%;height:70px;"></script>
                    <script type="text/javascript">
                    //实例化编辑器                    
                    var ue = UE.getEditor('editor');
                    </script>
                </div>
                <div class="mod-body-button">
                    <span id="ms"></span>
                    <button type="button" id="spbutton" class="btn btn-success">发表短评</button>
                </div>             
            </form>
        </div>        
        @else
        <div class="aw-mod aw-replay-box question">
            <p align="center">要发表书评请先<a href="{{asset('uslogin')}}">登录</a>或<a href="{{asset('usreg')}}">注册</a></p>
        </div>
        @endif 
    {{-- 回复编辑器 end--}}
    {{-- 短书评列表 --}}
        <div class="aw-mod aw-question-comment">
          <div class="mod-head">
            <span class="p1">短评 · · · · · ·</span>
          </div>
        </div>
        @if(count($bookscomments)!=0)
        @foreach($bookscomments as $bookscomment)
          <div class="mod-body aw-feed-list">
            <div class="aw-item">
              <div class="mod-head">
                <a class="aw-user-img aw-border-radius-5" href="{{url('u')}}/{{$bookscomment->users->uid}}">
                @if($bookscomment->users->avatar_file_min!="")
                  <img src="http://www.yedushu.com/{{ $bookscomment->users->avatar_file_min }}">
                @else
                  <img src="http://www.yedushu.com/usersface/default/avatar-min.png">
                @endif
                </a>
                <div class="title">
                  <p>
                  <a class="aw-user-name" href="{{url('u')}}/{{$bookscomment->users->uid}}">{{ $bookscomment->users->user_name }}</a>
                  <span class="rating allstar{{$bookscomment->rating}}0"></span>
                  </p>
                </div>
                <div class="mod-body clearfix">
                  <div class="markitup-box">{!! $bookscomment->message !!}</div>
                </div>
                <div class="mod-footer">
                  <div class="meta clearfix">
                    <span class="text-color-999 pull-right">{{date('Y-m-d H:i',$bookscomment->add_time)}}</span>
                  </div>
                </div>
              </div>
            </div>              
          </div>   
        @endforeach
        @else
        <div class="aw-no-list">暂时没有书评！</div>
        @endif
        {{-- 书评列表 end--}}
  </div>
  <div class="aside">
  <div class="indent">
    <p>文明上网理性发言。</p>
  </div>  
  <div class="pl2"><a href="{{url('info')}}/{{$books->book_id}}">{{$books->book_name}}</a></div>
  <div class="rebook">
    <a href="{{url('info')}}/{{$books->book_id}}"><img src="{{url($books->bimg)}}"></img></a>
    <br/>
    @if($books->zuozhe!="") <span class="p1">作者:{{ $books->zuozhe }}</span><br/> @endif
    @if($books->yuanzuoming!="") <span class="p1">原作名:{{ $books->yuanzuoming }}</span><br/> @endif
    @if($books->isbn!="") <span class="p1">isbn:{{ $books->isbn }}</span><br/> @endif
    @if($books->book_name!="") <span class="p1">书名:{{ $books->book_name }}</span><br/> @endif
    @if($books->yeshu!="") <span class="p1">页数:{{ $books->yeshu }}</span><br/> @endif
    @if($books->yizhe!="") <span class="p1">译者:{{ $books->yizhe }}</span><br/> @endif
    @if($books->dingjia!="") <span class="p1">定价:{{ $books->dingjia }}</span><br/> @endif
    @if($books->chubanshe!="") <span class="p1">出版社:{{ $books->chubanshe }}</span><br/> @endif
    @if($books->zhuangzhen!="") <span class="p1">装帧:{{ $books->zhuangzhen }}</span><br/> @endif
    @if($books->chubannian!="") <span class="p1">出版年:{{ $books->chubannian }}</span><br/> @endif
  </div>
  </div>
</div>
</div>
@include('books.partials.footer')
</body>
</html>
